export function modifyMap(viewer) { // 修改底图
    let baseLayer = viewer.imageryLayers.get(0)
    baseLayer.invertColor = true
    baseLayer.filterRGB = [0,50,100]
    const baseFragmentShader = viewer.scene.globe._surfaceShaderSet.baseFragmentShaderSource.sources
    for (let i = 0; i < baseFragmentShader.length; i++) {
        const strS = 'color = czm_saturation(color, textureSaturation);\n#endif\n'
        let strT = 'color = czm_saturation(color, textureSaturation);\n#endif\n'
        if (baseLayer.invertColor) {
            strT += `
                color.r = 1.0 - color.r;
                color.g = 1.0 - color.g;
                color.b = 1.0 - color.b;
            `
        }
        if (baseLayer.filterRGB.length) {
            strT += `
                color.r = color.r *${baseLayer.filterRGB[0]}.0/255.0;
                color.g = color.g *${baseLayer.filterRGB[1]}.0/255.0;
                color.b = color.b *${baseLayer.filterRGB[2]}.0/255.0;
            `
        }
        baseFragmentShader[i] = baseFragmentShader[i].replace(strS, strT)
    }

}